package com.ss.android.article.base.feature.e;

import android.app.Activity;
import android.view.View;
import com.ss.android.account.Spipe;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.update.a.d;
import com.ss.android.article.base.ui.BaseActionDialog;
import com.ss.android.article.base.ui.BaseActionDialog.DisplayMode;
import com.ss.android.article.common.share.abs.AbsShareHelper;
import com.ss.android.article.common.share.helper.CommonQQShareHelper;
import com.ss.android.article.common.share.helper.CommonQZoneShareHelper;
import com.ss.android.article.common.share.helper.CommonWXShareHelper;
import com.ss.android.article.share.e.b;
import com.ss.android.common.lib.MobClickCombiner;

import java.util.EnumSet;
import org.json.JSONObject;

public final class k implements b {
    private Activity a;
    private AppData b;
    private d c;
    private int d;
    private String e;

    public k(Activity arg2, d arg3, String arg4) {

        this.a = arg2;
        Spipe.inst();
        this.b = AppData.getInstance();
        this.c = arg3;
        this.e = arg4;
        this.d = 203;
    }

    public final void a() {
        long v10;
        long v12 = 0;
        EnumSet v6 = null;
        BaseActionDialog v0 = new BaseActionDialog(this.a, this, this.d, this.e, DisplayMode.UPDATE_SHARE, v6);
        v0.getWindow().setLayout(-2, -2);
        v0.show();
        if(this.c != null) {
            v10 = this.c.i;
            v0.d = v10;
        }
        else {
            v10 = v12;
        }

        v0.f = ((JSONObject)null);
        MobClickCombiner.onEvent(this.a, this.e, "share_button", v10, v12, ((JSONObject)null));
    }

    private void a(int arg4) {
        this.a(m.a(arg4));
        CommonWXShareHelper v0 = CommonWXShareHelper.getInstance(this.a, this.b, arg4);
        v0.b();
        ((AbsShareHelper)v0).mExtJsonObj = null;
        v0.a(this.c, new Object[0]);
    }

    private void a(String arg10) {
        if(this.c != null && !android.support.design.a.isTextEmpty(arg10)) {
            MobClickCombiner.onEvent(this.a, this.e, arg10, this.c.i, 0, null);
        }
    }

    public final boolean a(com.ss.android.article.share.entity.a arg5, View arg6, com.ss.android.article.share.c.a arg7) {
        JSONObject v3 = null;
        boolean v0 = true;
        boolean v1 = false;
        if(arg5 != null) {
            switch(arg5.e) {
                case 1: {
                    this.a(1);
                    break;
                }
                case 2: {
                    this.a(0);
                    break;
                }
                case 3: {
                    CommonQQShareHelper v1_2 = new CommonQQShareHelper(this.a);
                    ((AbsShareHelper)v1_2).mExtJsonObj = v3;
                    v1_2.a(this.c);
                    this.a("share_qq");
                    break;
                }
                case 4: {
                    CommonQZoneShareHelper v1_1 = new CommonQZoneShareHelper(this.a);
                    ((AbsShareHelper)v1_1).mExtJsonObj = v3;
                    ((CommonQQShareHelper)v1_1).a(this.c);
                    this.a("share_qzone");
                    break;
                }
                default: {
                    v0 = false;
                    break;
                }
            }

            v1 = v0;
        }

        return v1;
    }
}

